temp = int(input())
temp_unit = input()
height = int(input())
height_unit = input()
if temp_unit == 'F':
    temp_c = (temp - 32) * 5 / 9
else:
    temp_c = temp
if height_unit == 'ft':
    height_m = height * 0.3048
else:
    height_m = height
boiling_point = 100 - (height_m / 300)
if temp_c <= 0:
    print("solid")
elif temp_c < boiling_point:
    print("liquid")
else:
    print("gaseous")
